Skip to content

autodiff: Extend typetree generation to cover extractvalue. - #158952

Draft
ZuseZ4 wants to merge 1 commit into
rust-lang:mainfrom
ZuseZ4:typetrees-for-enzyme5
Draft

autodiff: Extend typetree generation to cover extractvalue.#158952
ZuseZ4 wants to merge 1 commit into
rust-lang:mainfrom
ZuseZ4:typetrees-for-enzyme5

Conversation

@ZuseZ4

@ZuseZ4 ZuseZ4 commented Jul 8, 2026

Copy link
Copy Markdown
Member

Further typetree improvements after #158333, to generate type information for the extractvalue builder.
I factored out this uncontroversial change from #158440, since the memcpy handling there will need more work.

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs F-autodiff `#![feature(autodiff)]` S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 8, 2026
@ZuseZ4 ZuseZ4 changed the title Extend typetree generation to cover extractvalue and pass the testcase. autodiff: Extend typetree generation to cover extractvalue and pass the testcase. Jul 8, 2026
@ZuseZ4 ZuseZ4 changed the title autodiff: Extend typetree generation to cover extractvalue and pass the testcase. autodiff: Extend typetree generation to cover extractvalue. Jul 8, 2026
use crate::traits::*;
use crate::{MemFlags, TyCtxt};

fn option_ptr_like_scalar_pair_tts<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Option<TypeTree> {

@ZuseZ4 ZuseZ4 Jul 8, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rust-log-analyzer

This comment has been minimized.

@ZuseZ4
ZuseZ4 force-pushed the typetrees-for-enzyme5 branch from 478fa79 to 8a1daa1 Compare July 8, 2026 13:57
@rust-log-analyzer

This comment has been minimized.

@ZuseZ4
ZuseZ4 force-pushed the typetrees-for-enzyme5 branch from 8a1daa1 to 89cc0d2 Compare July 8, 2026 14:43
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
##[endgroup]
[TIMING:end] tool::ToolBuild { build_compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu, tool: "tidy", path: "src/tools/tidy", mode: ToolBootstrap, source_type: InTree, extra_features: [], allow_features: "", cargo_args: [], artifact_kind: Binary } -- 10.794
[TIMING:end] tool::Tidy { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu } -- 0.000
fmt check
Diff in /checkout/compiler/rustc_codegen_ssa/src/mir/operand.rs:19:
 use super::place::{PlaceRef, PlaceValue};
 use super::rvalue::transmute_scalar;
 use super::{FunctionCx, LocalRef};
+use crate::MemFlags;
 use crate::common::IntPredicate;
 use crate::traits::*;
-use crate::MemFlags;
 
 /// The representation of a Rust value. The enum variant is in fact
 /// uniquely determined by the value's type, but is kept as a
Diff in /checkout/compiler/rustc_middle/src/ty/typetree.rs:1:
 use rustc_ast::expand::typetree::{FncTree, Kind, Type, TypeTree};
-use tracing::trace;
 use rustc_hir::LangItem;
 use rustc_span::sym;
+use tracing::trace;
 
---
 
 /// Generate a TypeTree for a specific type.
 /// Mainly a convenience wrapper around the actual implementation.
Diff in /checkout/compiler/rustc_codegen_llvm/src/builder.rs:1268:
             unsafe { llvm::LLVMBuildExtractValue(self.llbuilder, agg_val, idx as c_uint, UNNAMED) };
         if let Some(tt) = tt {
             let fnc_tree = FncTree { args: vec![], ret: tt };
-            crate::typetree::add_tt(
-                self,
-                extract,
-                fnc_tree,
-            );
+            crate::typetree::add_tt(self, extract, fnc_tree);
         }
         extract
     }
fmt: checked 6997 files
Bootstrap failed while executing `test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck`

@rust-bors

rust-bors Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #160814) made this pull request unmergeable. Please resolve the merge conflicts by rebasing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs F-autodiff `#![feature(autodiff)]` S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants